<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoldChildrenTable extends Migration
{
    public function up()
    {
        Schema::create('gold_children', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->default(0)->index();
            $table->unsignedInteger('records_children_count')->default(0);
            $table->unsignedInteger('more_than_last_day')->default(0);
            $table->unsignedInteger('more_than_first_day')->default(0);
            $table->timestamps();
            $table->index(['created_at']);
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('gold_children');
    }
}
